package com.usian.pojo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import javax.naming.Name;
import javax.persistence.Column;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Transient;
import java.io.Serializable;
import java.util.Date;

@Data
@TableName(value = "user")
public class User implements Serializable {
    /**
     * mybatis
     * @Column(name = "userId") 实体类和数据库字段不一致
     * @Id 标识主键
     *
     * mybaitsplus
     * @TableField(value = "userName") 实体类和数据库字段不一致
     * @TableId(type = IdType.AUTO) 标识主键
     *
     */

    @TableId(type = IdType.AUTO ,value = "userId")
    //@Column(name = "userId") mybatis
    //@TableField(value = "userId")
    private Integer userId;
    //@Column(name = "userName")
    @TableField(value = "userName")
    private String userName;
    private String password;
    //@Column(name = "userDescription")
    @TableField(value = "userDescription")
    private String userDescription;
    //@Column(name = "inputDate")
    @TableField(value = "inputDate")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date inputDate;
    //@Column(name = "input_date_str") //数据库的字段名
    private String inputDateStr;
    //@Column(name = "role_id")
    private Integer roleId;
    //@Column(name = "user_type")
    private Integer userType;

}
